load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "cliccl",
    srcs = [
        "cliccl.go",
        "context.go",
        "debug.go",
        "demo.go",
        "ear.go",
        "flags.go",
        "gen.go",
        "mt.go",
        "mt_proxy.go",
        "mt_test_directory.go",
        "start.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/cliccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/baseccl",
        "//pkg/ccl/cliccl/cliflagsccl",
        "//pkg/ccl/securityccl/fipsccl",
        "//pkg/ccl/sqlproxyccl",
        "//pkg/ccl/sqlproxyccl/tenantdirsvr",
        "//pkg/ccl/storageccl/engineccl/enginepbccl",
        "//pkg/ccl/utilccl",
        "//pkg/ccl/workloadccl/cliccl",
        "//pkg/cli",
        "//pkg/cli/clierror",
        "//pkg/cli/clierrorplus",
        "//pkg/cli/cliflagcfg",
        "//pkg/cli/cliflags",
        "//pkg/cli/democluster",
        "//pkg/cli/exit",
        "//pkg/storage",
        "//pkg/storage/enginepb",
        "//pkg/storage/fs",
        "//pkg/util/log",
        "//pkg/util/log/severity",
        "//pkg/util/protoutil",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//oserror",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_lestrrat_go_jwx//jwk",
        "@com_github_olekukonko_tablewriter//:tablewriter",
        "@com_github_spf13_cobra//:cobra",
        "@com_github_spf13_pflag//:pflag",
    ],
)

go_test(
    name = "cliccl_test",
    size = "medium",
    srcs = [
        "ear_test.go",
        "gen_test.go",
        "main_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":cliccl"],
    deps = [
        "//pkg/build",
        "//pkg/ccl",
        "//pkg/ccl/baseccl",
        "//pkg/ccl/storageccl/engineccl",
        "//pkg/cli",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/storage/fs",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/util/envutil",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_spf13_cobra//:cobra",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
